<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class history_model extends MY_Model {
	
	protected $table = "history_contact";
	protected $key			= "id";
	protected $soft_deletes	= true;
	protected $date_format	= "datetime";
	protected $set_created	= false;
	protected $set_modified = false;
	
	protected $orderby = 'date';
	
	function find_all()
	{

		$this->db->select('history_contact.*, user.first_name,user.last_name');
		$this->db->from($this->table);
		$this->db->order_by($this->orderby, "asc"); 
		$this->db->join('user', 'user.id = history_contact.user_id');
		$query = $this->db->get();
		
		if (!empty($query) && $query->num_rows() > 0)
		{
			return $query->result();
		}
		
		#$this->error = $this->lang->line('bf_model_bad_select');
		#$this->logit('['. get_class($this) .': '. __METHOD__ .'] '. $this->lang->line('bf_model_bad_select'));
		return false;
	}
}
